<?php 

//on recupere l'objet seance
$seance=$request->getObject('seance');
$salles=$request->getObject('listeSalles');
$tab="";
//si on a un reellement un message
if(count($request->getMessages())>0){
$tabGlobal=$request->getMessages();
$tab=$tabGlobal[0];
}
//mode ajout
if ($seance->getId()==-1){
	$actionName='Creer';
}
//mode modif
else{
	$actionName='Modifier';
}
?>

		<form method="POST" name="formSeance" id="formSeance" onsubmit="return verifierFormSeance();" >
				<?php if($tab!=""){ echo $tab;}?>
				<fieldset class="fieldsetglobal">
				<legend class="titreRouge"><?php echo $actionName;?> une seance</legend>
				<input type="hidden" name="idseance" value="<?php echo  $seance->getId(); ?>" />
				<input type="hidden" name="idfilm" value="<?php echo  $seance->getFilm()->getId(); ?>" />
				<table class="tableauFormAdmin" border="0" cellpadding="2" cellspacing="0" >
					<tr>
						<td valign="top">Film selectionne :</td>
						<td> <?php echo $seance->getFilm()->getTitre(); ?></td>
					</tr>
					
					<tr>
						<td valign="top">Date de la seance :</td>
						<td><input type="text" name="dateseance" value="<?php echo  $seance->getDateSeance(); ?>" /><span  id="err_dateseance" ></span></td>
					</tr>
					
					<tr>
						<td valign="top">Heure de la seance  :</td>
						<td><input type="text" name="heureseance"  size="40" value="<?php echo   $seance->getHeureSeance(); ?>" /><span  id="err_heureseance" ></span></td>
					</tr>
					<tr>
						<td valign="top">Salle :</td>
						<td>
						<select name="idsalle">
						<?php foreach ($salles as $salle){
							$selected="";
							
							if ($salle->getNomSalle()==$seance->getSalle()->getNomSalle()){
								$selected="selected";
							}
							
							echo'<option value="'.$salle->getId().' "'.$selected.' >'.$salle->getNomSalle().'</option>';
						
						}
						?>
							
					
					</tr>
					
				</table>
				</fieldset>
					
				
					<div class="divsubmit">	
						<input type="hidden" name="module" value="seance"/>
						<input type="hidden" name="action" value="<?php echo  $actionName; ?>"/>
						<input type="submit" value="Valider"  />
					</div>
					
				</table>
			
				</form>